package com.power.utils;

import com.alibaba.fastjson.JSON;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * User: 朱雄
 * Date: 2020/09/28 20:25
 * Description:
 * Version: V1.0
 */
public class WriterUtil<T> {

    public static void getWriter(HttpServletResponse response,Object object) throws IOException {
        response.setContentType("application/json;charset=utf-8");
        response.getWriter().write(JSON.toJSONString(object));
        response.getWriter().flush();
        response.getWriter().close();
    }
}
